/*    */ package com.qmsk.business.manage.funcOper.controller;
/*    */ 
/*    */ import com.qmsk.business.manage.funcOper.dao.DutyFunOperDAO;
/*    */ import com.utils.gson.in.ParserDataSetJson;
/*    */ import com.utils.gson.out.GsonEbRst;
/*    */ import com.utils.jdbc.connection.DbConnection;
/*    */ import com.utils.web.RequestUtils;
/*    */ import com.utils.web.ResponseUtils;
/*    */ import java.sql.SQLException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.transaction.annotation.Transactional;
/*    */ import org.springframework.web.bind.annotation.PathVariable;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"/dutyFunOper"})
/*    */ public class DutyFunOperController
/*    */ {
/* 28 */   private static final Logger logger = Logger.getLogger(DutyFunOperController.class);
/*    */ 
/*    */   @Autowired
/*    */   private DutyFunOperDAO dao;
/*    */ 
/*    */   @RequestMapping(value={"find/shopId/{shopId}/pId/{pId}/{dutyId}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public void getListOfFunId(HttpServletRequest request, HttpServletResponse response, @PathVariable("pId") String pId, @PathVariable("dutyId") String dutyId)
/*    */   {
/*    */     try
/*    */     {
/* 38 */       GsonEbRst gsonEbRst = this.dao.getGsonOfParentId(pId, dutyId);
/* 39 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*    */     } catch (SQLException e) {
/* 41 */       logger.error(e);
/* 42 */       ResponseUtils.setErrorMsgResponse(
/* 43 */         RequestUtils.getFindDataErrorMessage(request), response);
/*    */     }
/*    */   }
/*    */ 
/*    */   @Transactional
/*    */   @RequestMapping(value={"insert/shopId/{shopId}"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
/*    */   public void insertList(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/*    */     try {
/* 52 */       ParserDataSetJson p = new ParserDataSetJson(
/* 53 */         request.getParameter("data"));
/* 54 */       int nResult = this.dao.applyUpdates(p);
/* 55 */       if (nResult > 0)
/* 56 */         DbConnection.commit();
/*    */       else {
/* 58 */         DbConnection.rollback();
/*    */       }
/* 60 */       ResponseUtils.setSqlResultResponse(nResult, 
/* 61 */         RequestUtils.getSqlInsertDataErrorMessage(request), 
/* 62 */         response);
/*    */     } catch (Exception e) {
/* 64 */       DbConnection.rollback();
/* 65 */       logger.error(e);
/* 66 */       ResponseUtils.setErrorMsgResponse(
/* 67 */         RequestUtils.getSqlInsertDataErrorMessage(request) + ":" + 
/* 68 */         e.getMessage(), response);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.manage.funcOper.controller.DutyFunOperController
 * JD-Core Version:    0.5.3
 */